let http = require("http");

let data = require("./data");

let server = http.createServer((req,res)=>{
    res.setHeader("Access-Control-Allow-Origin", "*")//跨域
    res.setHeader('Content-Type', 'text/html; charset=utf-8');//设置乱码

    var news =  JSON.stringify(data);
    res.end(news)
})

server.listen("3000");

console.log(3000);